<template>
  <view>
    <button @click="handleClick">Click Me</button>
	  <myFu2 
      :parentData="message" 
      :list="list"
      @change="handleEventFromChild"
      @sendDataToParent="handleEventFromChild2"
      /> 
  </view>
</template>

<script>
import { ref } from 'vue'
import uinFun from '@/uilt/uinFun'
import myFu2 from '@/components/my-fu2.vue';

export default {
	name: 'ParentComponent',
	components: {
		myFu2
	},
	
	setup() {
    const message = ref('我是发送参数')

    const list=ref([{
						url: '/static/c1.png',
						text: '发',
						badge: '0',
						type: "primary"
					},
					{
						url: '/static/c2.png',
						text: '发',
						badge: '1',
						type: "success"
					},])

    const handleClick = () => {
      message.value = new Date().toString()
    }
    const handleEventFromChild = (e) => {
      console.log(e)

    }
    const handleEventFromChild2= (e) => {
      console.log(e)
    }

    return {
      message,
      list,
      handleClick,
      handleEventFromChild,
      handleEventFromChild2
    }
  },
	onLoad(option) {
		uinFun.setBarTitle('调用父组件')
	}
 
}
</script>

<style scoped>
h1 {
  color: #3cc51f;
}
</style>
